package com.dfbz.demo02_InputStream;

import java.io.FileInputStream;
import java.io.InputStream;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo09_输入流的其他用法_available {
    public static void main(String[] args) throws Exception{


        InputStream is=new FileInputStream("001.txt");          // abcde

        byte[] data = new byte[8192];
        int len = is.read(data);


        System.out.println(new String(data));
        System.out.println("读取到的有效字节个数: "+len);

        is.close();
    }
}
